<template>
  <div class="cart">
    <nav-bar class="nav-bar">
      <div slot="center">购物车({{cartLength}})</div>
    </nav-bar>   
      <div>
        <cart-list class="cart-list" @stateChange2="stateChange2" />
      </div>
    <cart-bottom-bar></cart-bottom-bar>
  </div>
</template>

<script>
import NavBar from '@/components/common/NavBar'
import CartList from './childComponents/cartList.vue'
import cartBottomBar from './childComponents/cartBottomBar.vue'
export default {
  name:"Cart",
  components: {
    NavBar,
    CartList,
    cartBottomBar
  },
  data () {
    return {
      s: true
    }
  },
  computed: {
    cartLength() {
      return this.$store.state.cartList.length
    }
  }
}
</script>

<style scoped>
.nav-bar {
  background-color: var(--color-tint);
  color: aliceblue;
  font-weight: 700;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
}

.cart {
  height: 100vh;
  margin-top: 44px;
  width: 100%;
}

.content {
  height: calc(100%  - 49px);
  width: 100%;
}

.cart-list {
  width: 100%;
}
</style>